Apple II
Technical Notes
_____________________________________________________________________________
                                                  Developer Technical Support


Apple IIGS
#6:    Pen Pattern Data Structure

Revised by:    Keith Rollin                                     November 1988
Written by:    Guillermo Ortiz                                  December 1986

Some QuickDraw II calls require a pen pattern as input or return one as 
output; regardless of the drawing mode (320 mode or 640 mode) a pen pattern 
takes 32 bytes.
_____________________________________________________________________________

Early QuickDraw II documentation described the data structure to hold a pen 
pattern as follows:

TYPE 
    nibble  = 0..15;
    twobit   = 0..3;
    Pattern = RECORD CASE MODE OF
            mode320:(PACKED ARRAY [0..63] OF nibble);    { 32 bytes }
            mode640:(PACKED ARRAY [0..63] OF twobit);    { 16 bytes }
        END;

This declaration could lead one to believe that 16 bytes are enough when 
making calls to QuickDraw II in 640 mode.  This is not true.  Assembly 
language and C programmers should understand that a pen pattern will always 
take 32 bytes; the difference between modes is that QuickDraw II will ignore 
the second half if in 640 mode.


Further Reference
o    Apple IIGS Toolbox Reference, Volume 2

